/* 
 * File:   Window.cpp
 * Author: Jonte
 * 
 * Created on den 27 maj 2010, 10:39
 */

#include "headers/Window.h"
#include "headers/BoardView.h"
#include <SDL/SDL.h>
#include <SDL/SDL_gfxPrimitives.h>

/*
 * This function creates a new window and places it in the parameter passed
 * upon return of > 0, something bad has happened, and the passed value
 * is to be discarded
 */
int Window::spawnWindow(SDL_Surface * screen){

    if (SDL_Init(SDL_INIT_VIDEO) < 0 ) // <0 means we have an error
        return 1;

    if (!(screen = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, NULL))) {
        // Coming in here means we have an error
        SDL_Quit();
        return 1;
    }
}

Window::Window() {
    // Screen is defined in header
    spawnWindow(&screen);
    /*
	filledTrigonRGBA(
			&screen,
			10,10,
			200,200,
			400,400,
			255,200,100,255);

	while(true){
      boxRGBA(&screen, 
              210, 76, 
              325, 300,
              255, 0, 0, 150);

	SDL_Flip(&screen);
	}
    */

}

Window::Window(const Window& orig) {
}

Window::~Window() {
}

